extends KinematicBody2D

signal health_changed
signal dead

export (PackedScene) var Bullet  # 子弹
export (int) var speed # 初始速度
export (float) var rotation_speed # 坦克旋转速度
export (float) var gun_cooldown # 开枪降温
export (int) var health # 健康状态

var velocity = Vector2()
var can_shoot = true # 能否开枪
var alive = true # 是否存活

func _ready():
	$GunTimer.waite_time = gun_cooldown
	
func control(delta):
	pass
	
func _physics_process(delta):
	if not alive:
		return
	control(delta)
	move_and_slide(velocity)
